Skip to content

demo issue occuring in pybind11-stubgen#5628

Closed
dyollb wants to merge 1 commit into
pybind:masterfrom
dyollb:import_error
Closed

demo issue occuring in pybind11-stubgen#5628
dyollb wants to merge 1 commit into
pybind:masterfrom
dyollb:import_error

Conversation

@dyollb

@dyollb dyollb commented Apr 23, 2025

Copy link
Copy Markdown
Contributor

Description

Illustrates #5627

Distinct classes with the same name but in separate anonymous namespaces trigger

ImportError: generic_type: type "Foo" is already registered!

This seems to be a new behavior in the current master branch and did not happen in 2.13.6.

Suggested changelog entry:

@rwgk

rwgk commented Apr 23, 2025

Copy link
Copy Markdown
Collaborator

This is a known "feature" of clang:

See:

PR #4319

llvm/llvm-project#79367

test_unnamed_namespace_a.cpp
test_unnamed_namespace_a.py
test_unnamed_namespace_b.cpp
test_unnamed_namespace_b.py

(That's why I defensively use the long-winded namespaces in many of the test_class_sh_*.cpp files.)

@rwgk rwgk closed this Apr 23, 2025
@dyollb

dyollb commented Apr 23, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants